//
// Created by Jeffrey Wei on 2022/11/2.
// Copyright (c) 2022 CocoaPods. All rights reserved.
//

import Foundation
import SwiftAppKit

public struct BaseApiResponse: NetworkResponse {
    public var message: String?

    public var code: Int?

    public var data: Any?
    public var isSuccess: Bool {
        code == 0
    }

    public init?(json: Any) {
        guard let json = json as? [String: Any] else { return nil }
        message = json["message"] as? String
        code = json["code"] as? Int
        data = json["data"]
    }
}
